# -*- coding: utf-8 -*-
"""
-------------------------------------------------
Project Name: luffcity study project
File Name: 进程练习.py
Author: kij
Create Date: 2021/3/11
-------------------------------------------------
"""
# from multiprocessing import Process
#
#
# def show(name):
# 	print("Process name is " + name)
#
#
# if __name__ == "__main__":
# 	proc = Process(target=show, args=('subprocess',))
# 	proc.start()
# 	proc.join()

from multiprocessing import Process
from threading import currentThread
import time


class MyProcess(Process):
	def __init__(self, name):
		super(MyProcess, self).__init__()
		self.name = str(name)

	def run(self):
		print('process name :' + str(self.name))
		time.sleep(1)


if __name__ == '__main__':
	for i in range(3):
		p = MyProcess(i)
		p.start()
	for i in range(3):
		p.join()
	print(currentThread().getName())
